package com.tengju.bff.interfaces.manage.platform.message.assembler;

import com.tengju.bff.interfaces.shared.KVVO;
import com.tengju.support.domain.model.message.MessageChannel;
import com.tengju.support.domain.model.message.MessageContentType;
import com.tengju.support.domain.model.message.SendStatus;
import com.tengju.user.domain.model.user.StarLevelEnum;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author: 李大仙
 * @date: 2021/6/7 3:12 下午
 */
public class MessageAssembler {

    public static List<KVVO<String, Integer>> getStationLetterTypeList() {
        return MessageChannel.STATION_LETTER.getMessageTypes().stream()
                .map(messageType -> KVVO.of(messageType.getDesc(), messageType.getVal()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getMessageContentTypeList() {
        return Arrays.stream(MessageContentType.values())
                .map(messageContentType -> KVVO.of(messageContentType.getDesc(), messageContentType.getVal()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getMessageUserOrientationList() {
        return Arrays.stream(StarLevelEnum.values())
                .map(starLevelEnum -> KVVO.of(starLevelEnum.getUserOrientation(), starLevelEnum.getCode()))
                .collect(Collectors.toList());
    }

    public static List<KVVO<String, Integer>> getMessageSendStatusList() {
        return Arrays.stream(SendStatus.values())
                .map(sendStatus -> KVVO.of(sendStatus.getDesc(), sendStatus.getVal()))
                .collect(Collectors.toList());
    }
}
